import 'package:OASys/components/iconContainer.dart';
import 'package:flutter/material.dart';

class MenuItem extends StatelessWidget {
  final IconData itemIcon;

  final String itemName;

  final Widget toPage;

  final String routeName;

  MenuItem(this.itemIcon, this.itemName, this.toPage, this.routeName);

  @override
  Widget build(BuildContext context) {
    return Container(
      height: 100,
      width: 100,
      child: Card(
        shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.circular(20),
        ),
        elevation: 3,
        child: ButtonTheme(
          shape:
              RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
          child: RaisedButton(
            color: Color.fromRGBO(248, 248, 248, 0.9),
            child: Column(
              children: [
                SizedBox(
                  height: 15,
                ),
                IconContainer(
                  itemIcon,
                  size: 30,
                  bgColor: Color.fromRGBO(242, 242, 242, 1),
                ),
                SizedBox(
                  height: 5,
                ),
                Center(
                  child: Text(
                    "${this.itemName}",
                    style: TextStyle(fontSize: 13),
                  ),
                ),
              ],
            ),
            onPressed: () {
              print('');
              // Navigator.of(context)
              //     .push(MaterialPageRoute(builder: (context) => toPage));
              print('toProject');
              Navigator.of(context).pushNamed(routeName);
            },
          ),
        ),
      ),
    );
  }
}
